using System;
using System.Threading.Tasks;
namespace TciNewsReader_2014_04.Infrastructure
{
    public class TaskRunner
    {
        private readonly bool _isAsync;
        public TaskRunner(bool isAsync)
        {
            _isAsync = isAsync;
        }
        public void Run(Action a)
        {
            if (_isAsync)
            {
                Task.Run(a);
            }
            else
            {
                a();
            }
        }
    }
}